package com.kaluli.project.repository.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.kaluli.project.domain.entity.AdminUser;
import com.kaluli.project.domain.entity.KllUser;
import com.kaluli.project.domain.repository.KllAdminUserRepository;
import com.kaluli.project.domain.repository.KllUserRepository;
import com.kaluli.system.repository.AbstractRepositorySupport;

@Repository
public class KllAdminUserRepositoryImpl extends AbstractRepositorySupport<AdminUser>
		implements KllAdminUserRepository{

	
	

	@Override
	public AdminUser findByHupuId(String hupuUid) {
		AdminUser user = null;
		StringBuffer hql=new StringBuffer(" from AdminUser t where t.hupuUid=:hupuUid ");
		Map<String,Object> params=new HashMap<String, Object>();
		params.put("hupuUid", hupuUid);
		List<AdminUser> lists =  this.findHqlForMap(hql.toString(), params);
		if(lists!=null&&lists.size()>0){
			user = lists.get(0);
		}
		
		return user;
	}

	@Override
	protected Class<AdminUser> getEntityClass() {
		// TODO Auto-generated method stub
		return AdminUser.class;
	}

}
